package com.simin.mall.ui.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import com.simin.base.easy.adapter.BaseTemplate
import com.simin.base.easy.adapter.BaseViewHolder
import com.simin.mall.R
import com.simin.mall.entity.HomeDataEntity
import com.simin.mall.entity.HomeEntity

class HomeVerDataTemplate : BaseTemplate<HomeDataEntity, HomeVerDataTemplate.ViewHolder>() {


    override fun onCreateViewHolder(
        layoutInflater: LayoutInflater,
        parent: ViewGroup,
        viewType: Int
    ): ViewHolder {
        return ViewHolder(layoutInflater.inflate(R.layout.rv_home_ver_layout, parent, false))
    }

    override fun getDataType(): Any {
        return HomeDataEntity::class.java
    }

    class ViewHolder : BaseViewHolder<HomeDataEntity> {
        var icon: ImageView? = null
        var title: TextView? = null
        var desc: TextView? = null
        var rvList: RecyclerView? = null

        constructor(view: View) : super(view)

        override fun initView(context: Context?) {
            icon = findViewById(R.id.item_icon_img)
            title = findViewById(R.id.item_title_tv)
            desc = findViewById(R.id.item_desc_tv)
            rvList = findViewById(R.id.rv_list)
        }

        override fun onBindData(data: HomeDataEntity?) {
            try {

            }catch (e: Exception){
                e.printStackTrace()
            }
        }

    }
}